<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Button test</title>
<link rel="stylesheet" type="text/css" href="button.css" />
<link rel="stylesheet" type="text/css" href="my_button.css" />

<script type="text/javascript" src="../../os3jslib/liwe.js"></script>
<script type="text/javascript" src="../wwl.js"></script>

<!--
<script type="text/javascript" src="button.js"></script>
-->

<script type="text/javascript">
function init ()
{
	WWL.include ( 'button' );
	
	liwe.utils.wait_def ( 'WWL.button', do_all );
}

function do_all ()
{
	var b = new WWL.button ( 'prova' );
	var b2 = new WWL.button ( 'prova2' );

	b.label = "p1";
	b.class_name = "my";
	b.tooltip = "Bottone numero 1";
	b.render ( 'p1' );

	b.set_event ( "click", function () { alert ( "hello !!!" ); } );

	b2.label = "p2";
	b2.class_name = "stop";
	b2.tooltip = "Bottone di stop!";
	b2.render ( "p2" );

	b2.set_event ( "click", set_disabled );
}

var _is_disabled = false;

function set_disabled ()
{
	var b = WWL.button.get_instance ( 'prova' );

	_is_disabled = ! _is_disabled;

	b.disable ( _is_disabled );
};



</script>
</head>
<body onload="init()">
<div id="p1"></div>
<div id="p2"></div>

</body>
</html>
